import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '@/views/main/index'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/message',
    name: 'main',
    component: Main,
    children: [
      {
        path: '/message',
        name: 'message',
        meta: {
          icon: 'message'
        },
        component: () => import('@/views/message')
      },
      {
        path: '/book',
        name: 'book',
        meta: {
          icon: 'book'
        },
        component: () => import('@/views/book')
      },
      {
        path: '/collect',
        name: 'collect',
        meta: {
          icon: 'collect'
        },
        component: () => import('@/views/collect')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  }
]

const router = new VueRouter({
  routes
})

export default router
